#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    mypushButton=new QPushButton(this);
    mypushButton->setText("hello word");
    connect(mypushButton,&QPushButton::clicked,this,&Widget::handclick);

}                                             

Widget::~Widget()
{
    delete ui;
}
void  Widget::handclick()
{
    move(200,500);
    if(mypushButton->text()==QString("hello word"))
    {
        mypushButton->setText("hello qt");
    }
    else
    { mypushButton->setText("hello word");
        move(655,500);}
}


